package xyz.kongbai121.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.CacheNamespace;
import org.springframework.stereotype.Repository;
import xyz.kongbai121.demo.domain.Article;
import xyz.kongbai121.demo.util.MybatisRedisCache;

import java.util.List;


/**
 * 文章 Mapper
 * @author 空白
 */
@Repository
@CacheNamespace(implementation= MybatisRedisCache.class,eviction= MybatisRedisCache.class)
public interface ArticleMapper extends BaseMapper<Article> {
    /**
     *    查询所有文章
     * @param title     模糊查询
     * @return
     */
    List<Article> list(String title);

    /**
     *    查询指定文章
     * @param id     文章id
     * @return
     */
    Article get(Long id);

}
